<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

<h:body>
	<ui:composition template="/templates/templateCRUD.xhtml">
		<ui:param name="tituloCadastro"
			value="Cadastro de Bloqueio de Horários Aplicado a Todos os Médicos" />
		<ui:param name="tituloPesquisa" value="Pesquisa de Horários" />
		<ui:param name="tituloGrid" value="Lista de Horários" />
		<ui:param name="mbean" value="${negaHorarioGeralMB}" />
		<ui:define name="cadastro">
			<p:tabView>
				<p:tab title="Dados do Bloqueio">
					<h:panelGrid columns="3"
						columnClasses="coluna-direita, coluna-esquerda, coluna-esquerda">
						<h:outputText value="Data Início (*): " />
						<p:calendar value="#{mbean.bean.dataInicio}"
							disabled="#{mbean.readOnly}" required="true" label="Data Início"
							id="dataInicioCadastro" locale="pt" pattern="dd/MM/yyyy"
							mindate="#{mbean.dataMinima}" />
						<p:message for="dataInicioCadastro" showDetail="true"
							showSummary="true" />

						<h:outputText value="Hora Início (*): " />
						<p:calendar value="#{mbean.bean.horaInicio}"
							disabled="#{mbean.readOnly}" required="true" label="Hora Início"
							id="horaInicioCadastro" locale="pt" pattern="HH:mm"
							timeOnly="true" />
						<p:message for="horaInicioCadastro" showDetail="true"
							showSummary="true" />

						<h:outputText value="Data Término (*):" />
						<p:calendar value="#{mbean.bean.dataFim}"
							disabled="#{mbean.readOnly}" required="true" label="Data Término"
							id="dataTerminoCadastro" locale="pt" pattern="dd/MM/yyyy"
							mindate="#{mbean.dataMinima}" />
						<p:message for="dataTerminoCadastro" showDetail="true"
							showSummary="true" />

						<h:outputText value="Hora Término (*):" />
						<p:calendar value="#{mbean.bean.horaFim}"
							disabled="#{mbean.readOnly}" required="true" label="Hora Término"
							id="horaTerminoCadastro" locale="pt" pattern="HH:mm"
							timeOnly="true" />
						<p:message for="horaTerminoCadastro" showDetail="true"
							showSummary="true" />

						<h:outputText value="Motivo (*):" />
						<p:inputTextarea value="#{mbean.bean.motivo}"
							disabled="#{mbean.readOnly}" cols="54" rows="5" required="false"
							label="Motivo" id="motivoCadastro" />
						<p:message for="motivoCadastro" showDetail="true"
							showSummary="true" />
					</h:panelGrid>
				</p:tab>
			</p:tabView>
		</ui:define>

		<ui:define name="pesquisa">
			<h:panelGrid columns="4" cellpadding="4">
				<h:outputText value="Data Início : " />
				<p:calendar value="#{mbean.beanSearch.dataInicio}" locale="pt"
					pattern="dd/MM/yyyy" mindate="#{mbean.dataMinima}" />
			</h:panelGrid>
		</ui:define>

		<ui:define name="gridPesquisa">
			<p:column>
				<f:facet name="header">
					<h:outputText value="Data Início" />
				</f:facet>
				<h:outputText value="#{registro.dataInicio}">
					<f:convertDateTime pattern="dd/MM/yyyy" locale="pt_BR"
						timeZone="America/Sao_Paulo" />
				</h:outputText>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="Hora Início" />
				</f:facet>
				<h:outputText value="#{registro.horaInicio}">
					<f:convertDateTime pattern="HH:mm" locale="pt_BR"
						timeZone="America/Sao_Paulo" />
				</h:outputText>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="Data Término" />
				</f:facet>
				<h:outputText value="#{registro.dataFim}">
					<f:convertDateTime pattern="dd/MM/yyyy" locale="pt_BR"
						timeZone="America/Sao_Paulo" />
				</h:outputText>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="Hora Término" />
				</f:facet>
				<h:outputText value="#{registro.horaFim}">
					<f:convertDateTime pattern="HH:mm" locale="pt_BR"
						timeZone="America/Sao_Paulo" />
				</h:outputText>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="Motivo" />
				</f:facet>
				<h:outputText value="#{registro.motivo}" />
			</p:column>
		</ui:define>
	</ui:composition>
</h:body>
</html>
